package com.czxy.Demo20;

import org.apache.commons.io.FileUtils;

import java.io.File;
import java.io.IOException;
import java.util.*;

public class Test {
    public static void main(String[] args) throws IOException {
        List<String> list = FileUtils.readLines(new File("data.txt"));
        Set<String> set = new HashSet<>();
        for (String s : list) {
            String[] split = s.split("");
            for (String s1 : split) {
                set.add(s1);
            }
        }
        String str = "";
        for (String s : set) {
            str+=s;
        }
        FileUtils.writeStringToFile(new File("result.txt") , str , "UTF-8");
    }
}